<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$model_name=$channel['name'];
$model_sub_name=$channel['sub_name'];
$menu_name=$channel['en_name'];
$sub_meun_name='category';
$page_name=$model_sub_name."分类";
//error_reporting(0); //抑制所有错误信息
?>

<?php require_once 'public/header.php';?>
<?php require_once 'public/sidebar.php';?>

<div id="content">
    <div id="content-header">
      <div id="breadcrumb">
          <a href="<?php echo site_url($this->config->item('system_manage_path')."welcome");?>" title="系统首页" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> 
          <a href="<?php echo site_url($this->config->item('system_manage_path').$menu_name);?>" title="<?php echo $model_name;?>" class="tip-bottom"><?php echo $model_name;?></a> 
          <a class="current"><?php echo $model_sub_name;?>分类</a> 
      </div>
      <h1><?php echo $model_sub_name;?>分类</h1>
    </div>
    
    <div class="container-fluid">
      <div class="row-fluid">
        <div class="alert alert-block"> <a class="close" data-dismiss="alert" href="#">×</a>
            <h4 class="alert-heading">注意：</h4>
            <span class="badge badge-warning">1</span> 删除分类同时将删除该分类下所有的<?php echo $model_sub_name;?>！<br />
            <span class="badge badge-warning">2</span> 有子分类的类别下,请勿添加<?php echo $model_sub_name;?>！ <br />
            <span class="badge badge-warning">3</span> 网站一但建立，请不要轻易删除某一分类，建议如果需要删除+添加操作请进行更新操作，如需大规模重置数据，请联系制作人员。 
        </div>
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
            <h5>操作选项：<a href="<?php echo site_url($this->config->item('system_manage_path')."category/".$channel['en_name']);?>">分类管理首页</a> | <a href="<?php echo site_url($this->config->item('system_manage_path')."category/".$channel['en_name']."/add");?>">新建<?php echo $model_sub_name;?>分类</a> </h5> 
          </div>
          
          <div class="widget-content" style="padding-bottom:0px;">
            <table class="table table-bordered table-striped">
              <thead>
                <tr>
                  <th width="5%">ID</th>
                  <th><?php echo $model_sub_name;?>分类名称</th>
                  <th width="5%">排序</th>
                  <th width="250">操作</th>
                </tr>
              </thead>
              <tbody>
                <?php foreach ($list as $value){ ?>
                <tr>
                  <td class="text-center"><?php echo $value['id'] ?></td>
                  <td><?php
                  if ($value['depth']=='2'){
                    echo "<i class='icon-chevron-right'></i> "; 
                  }
                  if ($value['depth']>2){
                      for ($i = 1; $i < $value['depth']; $i++) {
                          echo "<i class='icon-chevron-right'></i> "; 
                      }
                  }
                  ?><?php echo $value['name'] ?></td>
                  <td><?php echo $value['sort'] ?></td>
                  <td class="text-center"><a href="<?php echo site_url($this->config->item('system_manage_path')."category/".$channel['en_name']."/add/".$value['id']) ?>" class="btn btn-success btn-mini"><i class="icon-edit icon-white"></i> 添加子类</a> <a href="<?php echo site_url($this->config->item('system_manage_path')."category/".$channel['en_name']."/edit/".$value['id']) ?>" class="btn btn-success btn-mini"><i class="icon-edit icon-white"></i> 编辑分类</a> <a href="<?php echo site_url($this->config->item('system_manage_path')."category/".$channel['en_name']."/save/del/".$value['id']) ?>" class="btn btn-danger btn-mini" onClick="return confirm('您确认要删除吗?')"><i class="icon-remove icon-white"></i> 删除分类</a></td>
                </tr>
                <?php }?>
              </tbody>
            </table>
          </div>
          
        </div>
      </div>
    </div>
</div>

<?php require_once 'public/footer.php';?>